<%
/**
 *  构造根节点api
 *
 *  $Author: amon_lei $
 *  $Date: 2004/12/13 13:12:31 $
 *  $Revision: 1.2 $ 
 *  created in 2004-12-12
 */
%>
<%!
        public String makeRootNodeView(String id,
                                       String name,
                                       String nodeType,
                                       String onclickJS,
                                       String openImg,
                                       String closeImg
                                       )
        {
                StringBuffer treeNode=new StringBuffer(500);       
                //非最顶根节点
                if(id != null)
                {
                        treeNode.append("var Node" + nodeType);
                        treeNode.append(id);
                        treeNode.append(" = new WebFXTree('");
                        treeNode.append(name);
                        treeNode.append("',\"");
                        //点击执行js
                        treeNode.append(onclickJS);
                        treeNode.append("\",\"\",\"");  //sBehavior
                        // 展开前图片
                        treeNode.append(closeImg);
                        treeNode.append("\"" + ",\"");
                        // 展开后图片
                        treeNode.append(openImg);
                         //节点id
                        treeNode.append("\",\"");
                        treeNode.append(id);
                        treeNode.append("\",\"");
                        //节点类型
                        treeNode.append(name);
                        treeNode.append("\");");
                        treeNode.append("var Node" + nodeType + " = Node" + id + ";");        
                }
                else
                {
                        return"alert('该api是给rootId不为null用的');";
                }
                treeNode.append("Node" + nodeType + id + ".setBehavior('classic');");
                treeNode.append("var Node0 = Node" + nodeType + "null;");
                return treeNode.toString();	
        }

        public String makeRootNodeView(String nodeType,
                                       String id,
                                       String visibleImg)
        {
                StringBuffer treeNode=new StringBuffer(500);       
                //非最顶根节点
                if(id == null)
                {
                        
                        treeNode.append("var Node" + nodeType);
                        treeNode.append(id);
                        treeNode.append(" = new WebFXTree('<img src=\"");
                        treeNode.append(visibleImg); 
                        treeNode.append("\">','javascript:doNothing()');");
                }
                else
                {
                        return"alert('该api是给rootId为null用的');";
                }
	            treeNode.append("Node" + nodeType + id + ".setBehavior('classic');");
                treeNode.append("var Node0 = Node" + nodeType + id + ";");
                return treeNode.toString();	
        }
%>
